/* GUI CONVERTED from adadcg4.i (converter v1.76) Mon May 27 10:16:13 2002 */
/* adadcg4.i - CHANGE CUSTOMER CODES IN A FILE (1-3 fields + salesperson)   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.             */
/* $Revision: 1.6.1.5 $                                                         */
/*V8:ConvertMode=Maintenance                                                */
/* REVISION: 7.3      LAST MODIFIED: 03/25/93   BY: afs *G875*/
/* REVISION: 7.3      LAST MODIFIED: 05/28/93   BY: MPP *GB39*/
/*                                   09/26/94   BY: jzs *GM54*/
/* REVISION: 7.4      LAST MODIFIED: 11/19/96   BY: *H0PD* Aruna Patil      */
/* REVISION: 8.6      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan       */
/* REVISION: 9.0      LAST MODIFIED: 03/10/99   BY: *M0B3* Michael Amaladhas */
/* REVISION: 9.0      LAST MODIFIED: 03/13/99   BY: *M0BD* Alfred Tan        */
/* REVISION: 9.1      LAST MODIFIED: 08/11/00   BY: *N0KK* jyn               */
/* REVISION: 9.1      LAST MODIFIED: 02/05/01   BY: *N0VG* Jyoti Thatte      */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.6.1.5 $    BY: Katie Hilbert         DATE: 04/15/02  ECO: *P06H*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/*! ***********************************************************************
*  This include block is used to change up to three address fields within *
*  the same record.  It is used only by adadcgp. and its subroutines.     *
*                                                                         *
*  {1}  =  file name                                                      *
*  {2}  =  old address                                                    *
*  {3}  =  new address                                                    *
*  {4}  =  first field to change           NOTE: {5} and {6} must exist,  *
*  {5}  =  second field to change          but can be set to the same     *
*  {6}  =  third field to change           value as {4} if not used.      *
*  {7}  =  salesperson array variable      If slsprsn array does not      *
*  {8}  =  number of elements in array     exist, use adadcg3.i.          *
*  {9}  =  additional where clause(must start with "and .").This argument *
*          is optional.To be used to further narrow the search criteria.  *
*                                                                         *
*  NOTE: This routine requires an the variable jk defined as an integer.  *
**************************************************************************/

/* ALL PREVIOUS PATCH MARKERS REMOVED SINCE THE CODE IS REWRITTEN */
/* TO AVOID UNNECESSARY RECORD LOCKING.PREVIOUS VERSIONS OF THE   */
/* CODE CAN BE VIEWED USING RCS                                   */

hide message no-pause.

num_rec = 0.

for each {1} where {4} = {2} {9} exclusive-lock:
   {4} = {3}.
   if {5} = {2} then
      {5} = {3}.
   if {6} = {2} then
      {6} = {3}.
   do jk = 1 to {8}:
      if {7}[jk] = {2} then
         {7}[jk] = {3}.
   end.
   num_rec = num_rec + 1.
   release {1}.
end.

if "{4}" <> "{5}" then do:
   for each {1} where {5} = {2} {9} exclusive-lock:
      {5} = {3}.
      if {6} = {2} then
         {6} = {3}.
      do jk = 1 to {8}:
         if {7}[jk] = {2} then
            {7}[jk] = {3}.
      end.
      num_rec = num_rec + 1.
      release {1}.
   end.
end.

if "{5}" <> "{6}" then do:
   for each {1} where {6} = {2} {9} exclusive-lock:
      {6} = {3}.
      do jk = 1 to {8}:
         if {7}[jk] = {2} then
            {7}[jk] = {3}.
      end.
      num_rec = num_rec + 1.
      release {1}.
   end.
end.

{mfcscgb.i {1} } /* DISPLAY COUNT IN STATUS FRAME B, OF RECORDS HIT */
